better import xlsx heights
don't call UpdateAllRowHeights when IsAdjustHeightEnabled property is set and additionally set manual heights for *all* imported row heights ( same afaics xls import does ) - certainly this improves import ( also see documents attached in i#94028, i#93609 )
Change-Id: Id8aff727587ed4fa19fd0897aaf25b2202737084
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 6d4e305..2a04f8a 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -793,8 +793,6 @@
{
if( const EditTextObject* pEditObj = static_cast< const ScEditCell* >( rDoc.GetCell( rStart ) )->GetData() )
bTextWrap = pEditObj->GetParagraphCount() > 1;
if( bTextWrap )
setManualRowHeight( rStart.Row() );
}
}
}
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 43c1b33..48dc7d6 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -342,8 +342,6 @@
@descr Row default formatting is converted directly, other settings
are cached and converted in the finalizeImport() call. */
void setRowModel( const RowModel& rModel );
/** Specifies that the passed row needs to set its height manually. */
void setManualRowHeight( sal_Int32 nRow );
/** Initial conversion before importing the worksheet. */
void initializeWorksheetImport();
@@ -401,7 +399,6 @@
RowModelRangeMap maRowModels; /// Ranges of rows sorted by first row index.
HyperlinkModelList maHyperlinks; /// Cell ranges containing hyperlinks.
ValidationModelList maValidations; /// Cell ranges containing data validation settings.
ValueRangeSet maManualRowHeights; /// Rows that need manual height independent from own settings.
SheetDataBuffer maSheetData; /// Buffer for cell contents and cell formatting.
CondFormatBuffer maCondFormats; /// Buffer for conditional formatting.
CommentsBuffer maComments; /// Buffer for all cell comments in this sheet.
@@ -938,11 +935,6 @@
lclUpdateProgressBar( mxRowProgress, maUsedArea, nRow );
}
void WorksheetGlobals::setManualRowHeight( sal_Int32 nRow )
{
maManualRowHeights.insert( nRow );
}
void WorksheetGlobals::initializeWorksheetImport()
{
// set default cell style for unused cells
@@ -1236,10 +1228,7 @@
custom height, otherwise get all rows specified in the class member
maManualRowHeights that are inside the passed row model. */
ValueRangeVector aManualRows;
if( rModel.mbCustomHeight )
aManualRows.push_back( rRowRange );
else
aManualRows = maManualRowHeights.getIntersection( rRowRange );
aManualRows.push_back( rRowRange );
for( ValueRangeVector::const_iterator aIt = aManualRows.begin(), aEnd = aManualRows.end(); aIt != aEnd; ++aIt )
{
PropertySet aPropSet( getRows( *aIt ) );
@@ -1551,11 +1540,6 @@
mrSheetGlob.setRowModel( rModel );
}
void WorksheetHelper::setManualRowHeight( sal_Int32 nRow )
{
mrSheetGlob.setManualRowHeight( nRow );
}
void WorksheetHelper::putValue( const CellAddress& rAddress, double fValue ) const
{
ScAddress aAddress;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index a7589d8..2220e2d 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1683,11 +1683,7 @@
bool bOldAdjustHeightEnabled = pDoc->IsAdjustHeightEnabled();
bool bAdjustHeightEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if( bOldAdjustHeightEnabled != bAdjustHeightEnabled )
{
pDoc->EnableAdjustHeight( bAdjustHeightEnabled );
if( bAdjustHeightEnabled )
pDocShell->UpdateAllRowHeights();
}
}
else if ( aString.EqualsAscii( SC_UNO_ISEXECUTELINKENABLED ) )
{